import config from '@/config.js'
export function uploadFile(filePath){
	return new Promise((resolve,reject)=>{
		uni.uploadFile({
			url:config.requestUrl+'/upload',
			filePath,
			header: { "Content-Type": "multipart/form-data" },
			name:'file',
			success:(res)=>{
				resolve(res)
			},
			fail:(res) =>{
				reject(res)
			}
		})
	})
}
export function downloadFile(url){
	return new Promise((resolve,reject)=>{
		uni.downloadFile({
			url,
			success:(res)=>{
				resolve(res)
			},
			fail:(res) =>{
				reject(res)
			}
		})
	})
}